package com.jm.offer.easy;

import java.util.Arrays;
import java.util.OptionalInt;

/**
 * @Description https://leetcode-cn.com/problems/xuan-zhuan-shu-zu-de-zui-xiao-shu-zi-lcof/
 * 二分查找，但是一点不会
 * @date 2022/4/8 8:32
 */
public class _11旋转数组的最小数字 {
    public static void main(String[] args) {
        int[] arr = {1,2,3,4,5,0};
    }

    public static int minArray(int[] numbers) {
        int i = 0, j = numbers.length - 1;
        while (i < j) {
            int m = (i + j) / 2;
            if (numbers[m] > numbers[j]) {
                i = m + 1;
            } else if (numbers[m] < numbers[j]) {
                j = m;
            } else {
                j--;
            }
        }
        return numbers[i];
    }
}
